{% extends 'base.html' %}

{% block content %}

<form action="" method="post" novalidate>
    <!-- 生成防止CSRF攻击的令牌 -->
    {{ form.hidden_tag() }}
    <p>
        {{form.username.label}}<br/>
        <!-- size为将html或者css的属性传递给字段 -->
        {{form.username(size=32)}}<br/>
        {% for error in form.username.errors %}
        <span style="color: red;">[{{ error }}]</span><br/>
        {% endfor %}

    </p>
    <p>
        {{form.password.label}}<br/>
        {{form.password(size=32)}}<br/>
        {% for error in form.password.errors %}
        <span style="color: red;">[{{ error }}]</span><br/>
        {% endfor %}
    </p>
    <p>{{ form.remember_me() }} {{ form.remember_me.label }} </p>
    {{ form.submit() }}

    <p>New User? <a href="{{ url_for('register') }}">Click to Register!</a></p>

</form>

{% endblock %}